package com.campsys.core;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
@ApiModel("分页数据")
public class TableData<T> {

    @ApiModelProperty("状态码")
    private Integer code;
    @ApiModelProperty("提示消息")
    private String msg;
    @ApiModelProperty("数据")
    private List<T> row;
    @ApiModelProperty("数量")
    private Long total;


    public static TableData success(List list,Long total){
        return new TableData(200,"操作成功",list,total);
    }

}
